package com.nyist.zk.service.impl;

import com.nyist.zk.dao.BloodManagerDao;
import com.nyist.zk.entities.BloodManager;
import com.nyist.zk.service.BloodManagerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.beans.Transient;
import java.util.List;

@Service
public class BloodManagerServiceImpl implements BloodManagerService {

    @Autowired
    private BloodManagerDao BloodManagerDao;

    @Override
    public boolean getBloodManagerByIdAndPassword(Integer bm_id, String bm_password) {
        BloodManager BloodManager = BloodManagerDao.getBloodManagerByIdAndPassword(bm_id, bm_password);
        if (BloodManager != null) {
            return true;
        }
        return false;
    }

    @Override
    public List<BloodManager> findAllBloodManager() {
        return BloodManagerDao.findAllBloodManager();
    }

    @Override
    public List<BloodManager> findBloodManagerByNameLike(String bm_name) {
        return BloodManagerDao.findBloodManagerByNameLike(bm_name);
    }

    @Override
    public BloodManager findByIdBloodManager(Integer bm_id) {
        return BloodManagerDao.findByIdBloodManager(bm_id);
    }

    @Override
    @Transient
    public void insertBloodManager(BloodManager BloodManager) {
        BloodManagerDao.insertBloodManager(BloodManager);
    }

    @Override
    @Transient
    public void deleteByIdBloodManager(Integer bm_id) {
        BloodManagerDao.deleteByIdBloodManager(bm_id);
    }

    @Override
    @Transient
    public void updateBloodManager(BloodManager BloodManager) {
        BloodManagerDao.updateBloodManager(BloodManager);
    }

}
